fix(dspark): reduce V2 working VRAM - #27
Conversation
32fdb44 to
d82b645
Compare
ced1c66 to
92d4c2b
Compare
|
Sorry, I missed this one |
dspark_inv_rope_bf16_layout and dspark_markov_greedy_argmax (and the two Triton kernels backing the latter) have no production callers anywhere in the tree; the live draft path uses the BF16 WO_A projection and the fused probabilistic Markov sampler (dspark_markov_probs_sample). Drop the dead wrappers, kernels, and their standalone tests.
92d4c2b to
f056ff7
Compare
Upstream vllm-project#48849 re-added `and self.data_parallel_size > 1` to `ParallelConfig.use_sequence_parallel_moe`, which disables sequence-parallel MoE for every DP=1 deployment — including DeepSeek-V4-Flash served at TP=2 with expert parallelism, where it costs ~5% decode throughput. The rationale comment directly above the property is about replication across the *tensor* parallel group: with the all_reduce at the end of attention, every TP rank holds the same tokens, so under EP the experts redo the same work on every rank. That argument does not depend on data_parallel_size, and the code had drifted away from its own comment. vllm-project#48849 was motivated by memory — ~5.6 GiB of SP buffers on a pure-TP Nemotron 550B — but it measured only memory, never throughput, and concluded "no benefit for any model" at DP=1. That does not hold here. Measured on DeepSeek-V4-Flash, 2x RTX PRO 6000 Blackwell (SM120), TP=2 + EP, DP=1, FP8 KV, DSpark MTP, at a fixed 250 W cap: C=1 decode (2 sets) 274.6 / 276.7 -> 288.2 / 289.8 tok/s (+5%) prefill 1K 5,948 -> 6,259 tok/s (+5%) prefill 4K 7,518 -> 7,536 tok/s (flat) available KV cache 11.44 GiB -> 11.44 GiB (identical) GPU KV cache tokens 1,189,790 -> 1,189,790 (identical) peak activation 1.89 GiB -> 1.13 GiB i.e. on this configuration the SP buffers cost no KV capacity whatsoever, so the trade vllm-project#48849 describes is not present and only the slowdown is. Draft acceptance was flat at 80.7% across both configurations, and GPU utilization stayed at 90-92%, so this is expert-path work and not a scheduling or speculation artifact. If the pure-TP memory regression still needs addressing, the gate should be made config-aware (or user-selectable) rather than switching SP-MoE off for all DP=1 deployments.
|
Merged — thanks, this was a substantial piece of work and it holds up well under review. The seven Validation on GB10 (2× SM121a, TP=2, MTP2, mml 49152, util 0.85, fp8 KV)
Unit suite green: 795 kv_offload, 6 DSv4 sparse-SWA/ubatch/indexer, 35 rejection sampler. Re-gated after merging 34 upstream commits on top: arthur c=1 2/2, IMA 0, and GSM8K three times Kernel-test A/B at Review notesThe parts that needed the most scrutiny were the in-place mutations, since geometry- and
Two deltas relative to your current branch head1. 2.
Your own commit message points at the right answer: make the gate config-aware rather than Two things worth knowing
Closing as merged. Thanks again. |
Summary
Reduces DeepSeek V4 / DSpark V2 working VRAM and increases usable KV cache on the 2x SM120 DSpark serving config.
Main changes:
mtp.n_local_heads == padded_heads; in that case the fused qnorm/RoPE/KV-insert op can write Q in place.[T, hc, H]just to producehc_headoutput and Eagle aux means.[T, hc, H]allocation.[T, H]profile allocation per rank without changing kernel math or launch count.Live memory result
Measured on 2x RTX PRO 6000 Blackwell / SM120, TP=2, DSpark V2, GMU 0.975, max model len 524288.
Net from baseline: +1.07 GiB available KV and +110,442 KV tokens.
Validation
git diff --check, targetedpy_compilepassed.tests/v1/spec_decode/test_dspark_config.py,test_rejection_sampler_utils.py,test_dspark.pypassed (48 passed).30 passed).7*8 -> 56.309.2 tok/s, median310.9, range304.7-311.4, versus current-step post-JIT baseline median297.7.6106 / 8004 / 7710 / 6369 tok/sat1K / 4K / 16K / 65Kprompt sizes.17 + 25 -> 42.tests/v1/spec_decode/test_dspark_config.py->2 passedtest_dense_draft_logits_index_mapping_matches_state_indexedandtest_gumbel_sample_stores_processed_logits_inplace->2 passed20 passed; deployed profile11.61 GiB/1,205,591tokens /2.30x; warm decode A/B307.6vs307.5 tok/s; final deployed warm median310.0 tok/s; coherency17 + 25 -> 42.max_tokens=500,temperature=0, thinking off):c=2275.7 aggregate tok/s (52.95% draft accept),c=4393.2 tok/s (55.07%),c=8577.9 tok/s (56.92%).286.5 tok/s; 65,539-token prompt median287.9 tok/s; both ~7% below the310.0 tok/sshort-context median with no further 64K degradation.